package com.github.beansoft.jadx.util;

import org.jf.smali.Smali;
import org.jf.smali.SmaliOptions;

import java.io.IOException;

public class Smali2DexUtil {
     public static void run(String input) {
        try {
            Smali.assemble(getOptions(), input);
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }

    static SmaliOptions getOptions() {
        SmaliOptions options = new SmaliOptions();

        options.jobs = 2;
//        options.apiLevel = apiLevel;
        options.outputDexFile = "beansoft.dex";
//        options.allowOdexOpcodes = allowOdexOpcodes;
        options.verboseErrors = true;

        return options;
    }

    public static void main(String[] args) {
        run("data/HelloWorld.smali");
    }
}
